<%--
    Document   : index
    Created on : Apr 4, 2011, 10:38:52 PM
    Author     : user
--%>

<%
    HttpSession sess = request.getSession(false);
    System.out.println(sess);
    String role = (String) sess.getAttribute("role");
    if(role != null){
        if (role.equalsIgnoreCase("admin")== false)
            response.sendRedirect("chat.jsp");
        else
            response.sendRedirect("admin.jsp");
    }
%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Welcome to On Air -- Register, Sign Up and Talk Anything...</title>
        <link rel="stylesheet" href="public/css/index.css" type="text/css" media=screen />
    </head>
    <body>
        <div id="wrap">
            <div id="header">
                <div id="logo">
                    <img src="public/img/header_logout.png" alt="logo" />
                </div>
                <div id="login">
                    <form name="loginForm" action="LoginServlet" method="post">
                        <div class="iinput"> <input type="text" name="username" /> </div>
                        <div class="iinput"> <input type="password" name="password" /> </div>
                        <div class="ibutton"><input type="submit" name="login" value="onAIR" /></div>
                        <div class="clear"></div>
                    </form>
                </div>
                <div class="clear"></div>
            </div>
            <div id="content">
                <div id="content-wrap">
                    <div id="left-column">
                        <img src="public/img/big speaker.png" alt="slogan" />
                    </div>
                    <div id="right-column">
                        <form name="registrasiForm" action="RegistrasiServlet" method="post">
                            <div class="field">
                                <div class="ilabel">Name </div>
                                <input type="text" name="name" />
                                <div class="clear"></div>
                            </div>
                            <div class="field">
                                <div class="ilabel">Username</div>
                                <input type="text" name="username" />
                                <div class="clear"></div>
                            </div>
                            <div class="field">
                                <div class="ilabel">Password</div>
                                <input type="password" name="password" />
                                <div class="clear"></div>
                            </div>
                            <div class="field">
                                <div class="ilabel">Email</div>
                                <input type="text" name="email" />
                                <div class="clear"></div>
                            </div>
                            <div class="ibutton"">
                                <input type="submit" name="register" value="Register" />
                            </div>
                        </form>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="clear"></div>
            <div id="footer">
                <div class="outer">
                    <div class="inner">onAIR ~ on Adi_Ifan_Rezan ~ Where talks is free.. :D
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>
